Skip to content

Conversation

@KristofferC
Copy link
Member

@KristofferC KristofferC commented Sep 14, 2022

can be used by JLLs to avoid scouring through the file system for the Artifacts.toml when it already knows where it is

JLLWrappers PR at JuliaPackaging/JLLWrappers.jl#45

Copy link
Member

@staticfloat staticfloat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call the value “artifacts_toml_path” or something like that, to avoid confusion with the actual path of the artifact we want to return?

KristofferC and others added 3 commits September 29, 2022 18:22
can be used by JLLs to avoid scour throgh the file system for the Artifacts.toml when it already knows where it is
We must provide the `platform` argument here before we provide the
`artifacts_toml_path` argument.
@staticfloat staticfloat force-pushed the kc/artifact_macro_explicit_path branch from 4013bc5 to 02f3df8 Compare September 29, 2022 18:25
@KristofferC
Copy link
Member Author

@staticfloat, good to go?

@staticfloat staticfloat merged commit 1720a54 into master Oct 3, 2022
@staticfloat staticfloat deleted the kc/artifact_macro_explicit_path branch October 3, 2022 14:59
find_artifacts_toml(srcfile)
else
artifacts_toml_path
eval(artifacts_toml_path)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try this @staticfloat? It seems to error for me:

In [3]: using Vulkan_Headers_jll
[ Info: Precompiling Vulkan_Headers_jll [8d446b21-f3ad-5576-a034-752265b9b6f9]
ERROR: LoadError: Evaluation into the closed module `Artifacts` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `Artifacts` with `eval` during precompilation - don't do this.
Stacktrace:
 [1] eval
   @ ./boot.jl:370 [inlined]
 [2] eval(x::String)
   @ Artifacts ~/julia/usr/share/julia/stdlib/v1.9/Artifacts/src/Artifacts.jl:3
 [3] var"@artifact_str"(__source__::LineNumberNode, __module__::Module, name::Any, platform::Any, artifacts_toml_path::Any)
   @ Artifacts ~/julia/usr/share/julia/stdlib/v1.9/Artifacts/src/Artifacts.jl:665

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I only tried it with the test set, which doesn't hit this error, apparently. @vtjnash what is the correct fix here? I don't really understand how to properly "get" the value of a string at compile-time I guess.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was it that failed before this change? I tried it with JLLWrappers and it seemed to work ok without the eval.

staticfloat added a commit that referenced this pull request Oct 10, 2022
This causes the eval to be invoked in user scope, rather than in the `Artifacts` module itself.

X-ref: #46755 (review)
DilumAluthge pushed a commit that referenced this pull request Oct 14, 2022
This causes the eval to be invoked in user scope, rather than in the `Artifacts` module itself.

X-ref: #46755 (review)
lgoettgens added a commit to lgoettgens/julia that referenced this pull request May 31, 2023
lgoettgens added a commit to lgoettgens/julia that referenced this pull request Jun 2, 2023
KristofferC pushed a commit that referenced this pull request Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants